package com.gqb.spring.framework;

import java.util.HashMap;
import java.util.Map;

import org.apache.commons.lang.ObjectUtils.Null;

import com.gqb.spring.tag.Bean;
import com.gqb.spring.tag.Beans;

public class BeanOperator {
	protected Beans beans=null;
	protected Map<String, Bean> beanIdBean=null;
	protected Map<String, Class> beanIdClass=null;
	protected Map<String, Object> beanIdObject=null;
	public BeanOperator() {
	}
	
	public BeanOperator(boolean init){
		if(init){
			beanIdBean=new HashMap<String, Bean>();
			beanIdClass=new HashMap<String, Class>();
			beanIdObject=new HashMap<String, Object>();
		}
	}

	public Beans getBeans() {
		return beans;
	}

	public void setBeans(Beans beans) {
		this.beans = beans;
	}

	public Map<String, Bean> getBeanIdBean() {
		return beanIdBean;
	}

	@SuppressWarnings("rawtypes")
	public Map<String, Class> getBeanIdClass() {
		return beanIdClass;
	}

	public Map<String, Object> getBeanIdObject() {
		return beanIdObject;
	}

	
	public void addObject(String beanId,Object object){
		this.beanIdObject.put(beanId, object);
	}
	
	public void addClass(String beanId,Class clazz){
		this.beanIdClass.put(beanId, clazz);
	}
	public void addBean(String beanID,Bean bean){
		this.beanIdBean.put(beanID, bean);
	}
}
